Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Show the worst possible workaround for QCL leak in tests #15151

Closed
wants to merge 1 commit into from

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Feb 17, 2021

Relates to: #12498

Even after these horrific hacks are applied, there seems to be another Netty related leak that I couldn't identity.

cc @stuartwdouglas

@stuartwdouglas
Copy link
Member

I don't think either of these are the underlying problem, these objects are loaded by the QuarkusClassLoader, the statics should not prevent GC. I had a look at the reproducer and if you exclude RESTAssured the leaks go away.

The real issue seems to be some kind of reflection cache in groovy that is doing funky things with SoftReference. I will investigate further but I think there will likely be some horrible groovy hack required.

@geoand
Copy link
Contributor Author

geoand commented Feb 22, 2021

That's odd, I couldn't find any trace of Groovy in the memory snapshots, but I might have missed it

@stuartwdouglas
Copy link
Member

So I see it in yourkit as not being 'strongly reachable' (i.e. it is being held by either soft/weak references or objects pending finalization). The thing is though that non matter how much GC is run it still does no get cleaned up.

@geoand
Copy link
Contributor Author

geoand commented Feb 22, 2021

OK cool. I see it now as well.

I had checked Ignore soft/weak references

@geoand
Copy link
Contributor Author

geoand commented Feb 22, 2021

The thing is though that non matter how much GC is run it still does no get cleaned up.

Any idea what could be causing it?

@stuartwdouglas
Copy link
Member

If you add quarkus.class-loading.parent-first-artifacts=org.codehaus.groovy:groovy the leak goes away.

I think it is technically a JVM bug, where there are basically soft references going everywhere and it does not realize that the ClassLoaders are eligible for GC. Figuring out exactly what causes this will take some investigation though.

@geoand
Copy link
Contributor Author

geoand commented Feb 24, 2021

I don't think more investigation is warranted if we can just make Groovy parent first and be done with it

@geoand
Copy link
Contributor Author

geoand commented Mar 2, 2021

Closing

@geoand geoand closed this Mar 2, 2021
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants